//
//  TSCMyUtil.h
//  Tsc_IOS
//
//  Created by Rio on 15-5-4.
//  Copyright (c) 2015年 idream. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <ShareSDK/ShareSDK.h>
#import "TSCSDK.h"


@interface TSCMyUtil : NSObject

+ (NSString *) dictionary2String:(NSDictionary *) dic;

+ (NSString *) implodeWithGlue:(NSString *)glue array:(NSArray *)array ;
+ (NSArray *) explodeString:(NSString *)string delimiter:(NSString *)delimiter;

+ (NSArray *) addGlue2Array:(NSString *)glue array:(NSArray *)array ;

+ (BOOL) isStringEmpty:(NSString *)string;
+ (BOOL) isArrayEmpty:(NSArray *)array;
+ (BOOL) isA:(NSArray *)aArr subsetOfB:(NSArray *) bArr;

+ (NSString *) trim:(NSString *)string;

+ (BOOL) hasSameElement:(NSArray* )array;

+ (void) executeBlockAfterTI:(CGFloat)ti block:(void(^)())block;

+ (void) clearUD:(NSUserDefaults *)ud;

+ (long) generateRandNumScopedMin:(long)min max:(long)max;
+ (NSString *) getMD5:(NSString *)string;
+ (UIViewController *) getCurrentViewController;

+ (NSInteger) translateShareType2Tsc3UserType:(ShareType)shareType; // 将ShareSDK的用户类型，转码为服务器端存储的用户类型
+ (void) logoutAllWithUserDefaults:(NSUserDefaults *)ud; // 将系统自己的登录数据，及所有三方（ShareSDK）方平台的登录信息，全部清除

+ (CGRect) getAbsoluteFrame:(UIView *)view;
+ (CGPoint) getAbsoluteCenter: (UIView *)view;
+ (CGRect) getAbsoluteBounds:(UIView *)view;

+ (NSString *) getFileDir:(NSInteger)fileType;
+ (NSString *) getFileSuffix:(NSInteger)fileType;
+ (NSString *) makeFile:(NSInteger)fileType fileName:(NSString *)fileName overwrite:(BOOL)overwrite;
+ (NSString *) copyFile:(NSInteger)fileType oldPath:(NSString *)oldFilePath overwrite:(BOOL)overwrite picUrl:(NSString *)picUrl;
+ (NSString *) fileUrl2FileName:(NSInteger)fileType fileUrl:(NSString *)fileUrl thumbnailType:(NSInteger)thumbnailType;
+ (NSString *) fileUrl2FilePath:(NSInteger)fileType fileUrl:(NSString *)fileUrl thumbnailType:(NSInteger)thumbnailType;
+ (BOOL) isUrl:(NSString *)maybeUrl;

+ (NSString *) getDateStrFromTs:(NSInteger)timestamp format:(NSString *)format;
+ (NSInteger) getTsFromDateStr:(NSString *)dateStr format:(NSString *)format;
+ (NSInteger) getTsTomorrow:(NSInteger)todayTs;
+ (NSString *) date2String:(NSDate *)date format:(NSString *)format;
+ (NSDate *) string2Date:(NSString *)dateString format:(NSString *)format;



@end
